using System;
using System.IO;

using Dashboard;
using Dashboard.Util;

namespace Dashboard.Mint.Tiles
{
	[Tile (Type = "db:file")]
	public class FileTile : Tile
	{
		public FileTile (Match match) : base (match)
		{
			string name = match.Properties.GetPropertyValue ("dc:title");

			if (String.IsNullOrEmpty (name))
				name = match.Properties.GetPropertyValue ("db:filename");

			Title = name;
		}

		public override Gdk.Pixbuf GetIcon (int size)
		{
			return Util.LoadMimeIcon (Match.Properties.GetPropertyValue ("db:mimetype"), 16);
		}
	}
}